import time
def a(x,N):
    for i in range(N-1):
        for j in range(N-i-1):
            if x[j] > x[j+1]:
                x[j], x[j+1] = x[j+1], x[j]
         

    
def z(b):
    file=open(b,"r")
    data=file.readlines()
    return data

m1=z("m1_sorted.txt")
razmer=len(m1)
t_start=time.time()
a(m1,razmer)
t_finish=time.time()
print("m1_sorted",round((t_finish-t_start)*1000),"milliseconds")


m2=z("m2_reverse.txt")
razmer=len(m2)
t_start=time.time()
a(m2,razmer)
t_finish=time.time()
print("m2_reverse",round((t_finish-t_start)*1000),"milliseconds")



m3=z("m3_shuffle.txt")
razmer=len(m3)
t_start=time.time()
a(m3,razmer)
t_finish=time.time()
print("m3_shuffle",round((t_finish-t_start)*1000),"milliseconds")



